package com.hadron.media.slideshow.patterns.mvc.model 
{
	import com.hadron.media.slideshow.enum.SlideshowStatus;
	import com.hadron.media.slideshow.items.ISlideshowItem;
	import temple.data.collections.HashMap;
	import temple.data.collections.ICollection;
	import temple.debug.IDebuggable;
	import temple.destruction.IDestructibleEventDispatcher;
	import temple.ui.IDisplayObject;
	import temple.ui.IHasBackground;
	
	/* dispatched when currentIndex changes */
	[Event (name = "indexChange", type = "com.hadron.media.slideshow.events.SlideshowModelEvent")] 
	/* dispatched when background needs to be redraw */
	[Event (name = "backgroundChange", type = "com.hadron.media.slideshow.events.SlideshowModelEvent")] 
	/* dispatched when all assets done loading */
	[Event (name = "itemsLoadComplete", type = "com.hadron.media.slideshow.events.SlideshowModelEvent")] 
	
	/**
	 * ...
	 * @author Hadron
	 */
	public interface ISlideshowModel extends IDebuggable, IDestructibleEventDispatcher
	{
		/**
		 * starts loading items
		 * only if xmlURL was set first or items collection is not empty!
		 */
		function load():void;
		/**
		 * determines if slideshow will start automatically 
		 * after loading process finishes
		 */
		function get autoPlay():Boolean;
		function set autoPlay(value:Boolean):void;
		/**
		 * determines if slideshow will load its items automatically
		 */
		function get autoLoad():Boolean;
		function set autoLoad(value:Boolean):void;
		/**
		 * how long assets will be displayed [sec]
		 */
		function get displayTime():Number;
		function set displayTime(value:Number):void;
		/**
		 * how long assets will fade in [sec]
		 */
		function get fadeTime():Number;
		function set fadeTime(value:Number):void;
		/**
		 * currently displayed item index in items array
		 */
		function get currentIndex():uint;
		function set currentIndex(value:uint):void;
		/**
		 * Collection of ISlideshowItem set to display
		 */
		function get items():ICollection;
		/**
		 * Returns current item
		 */
		function get currentItem():ISlideshowItem;
		function set currentItem(value:ISlideshowItem):void;
		/**
		 * xmlURL value - to automate loading process and variables instantiation
		 */
		function get xmlURL():String;
		function set xmlURL(value:String):void;
		/**
		 * returns status of slideshow component
		 */
		function get status():SlideshowStatus;
		function set status(value:SlideshowStatus):void;
		/**
		 * Determines if slideshow has its own background
		 */
		function get background():Boolean;
		function set background(value:Boolean):void;
		/**
		 * Determines opacity of slideshow background
		 */
		function get backgroundAlpha():Number;
		function set backgroundAlpha(value:Number):void;
		/**
		 * Determines background Color of slideshow
		 */
		function get backgroundColor():uint;
		function set backgroundColor(value:uint):void;
		/**
		 * Returns hash of name-item
		 */
		function get itemsByName():HashMap;
		/**
		 * Returns hash of url-item 
		 */
		function get itemsByURL():HashMap;
		/**
		 * Clears all data in a model
		 */
		function clear():void;
		/**
		 * Defines whether item should use its transition or not
		 */
		function get transition():Boolean;
		function set transition(value:Boolean):void;
		/**
		 * Resets display timer of a model
		 */
		function resetDisplayTimer():void;
	}
}